import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    num:10,
    city:"武汉"
  },
  mutations: {
    add(state){
      state.num++;
    },
    city_item(state,val){
      state.city=val;
    }
  },
  actions: {
    addNum(ctx){
      ctx.commit("add")
    },
    city(ctx,val){
      ctx.commit("city_item",val)
    }

  },
  modules: {
  }
})
